#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__

#include <QtGui>
#include "mainwidget.h"
#include "outputwidget.h"

class PathDialog:public QDialog
{
	Q_OBJECT
public:
	PathDialog ( QWidget * parent = 0, Qt::WindowFlags f = 0 );
	
signals:
	void path(const QString& konsole, const QString& rpmbuild);
private:
	QVBoxLayout *vlayout;
	QGridLayout *glayout;
	QLabel* Konsole;
	QLabel* Rpmbuild;
	QLineEdit* konsole;
	QLineEdit* rpmbuild;
	QGroupBox* box;
	QDialogButtonBox* bbox;
	
	void init_layout();
	void init_connect();
private slots:
	void sendPath();
};

class MainWindow:public QMainWindow
{
Q_OBJECT
public:
	MainWindow();
private:
	MainWidget* mainWidget;
	OutputWidget* outputWidget;
	PathDialog* pathDialog;
	
	QToolBar* toolBar;
	QAction* generateAct;
	QAction* saveAct;
	QAction* buildAct;
	
	QString konsole;
	QString rpmbuild;
	
	void init_actions();
	void init_toolBars();
	void init_statusBar();
	void init_filepath();
public slots:
	void generate();
	void save();
	void build();
	void setPath(const QString& konsole, const QString& rpmbuild);
};

#endif // __MAINWINDOW_H__
